package org.wattdepot.cli.command;

import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.wattdepot.cli.CommandLineInterface;

/**
 * Test that checks for valid output within the CarbonContentCommand class.
 * 
 * @author Anthony Xu & John Mack
 * 
 */

public class TestCarbonContent {
  
  /**
   * Test to see if CarbonContent class displays correct output for CO2 at a given time.
   * 
   * @throws Exception NotAuthorizedException, ResourceNotFoundException, BadXmlException,
   * MiscClientException.
   */
  @Test
  public void testingCarbonContent() throws Exception {
    CommandLineInterface cli = new CommandLineInterface();
    List<String> commands = new ArrayList<String>();
    commands.add("carboncontent");
    commands.add("SIM_KAHE");
    commands.add("2009-11-15T12:00:00.000-10:00");
    commands.add("sampling-interval");
    commands.add("10");
    
    String theAmountOfCO2 = new CarboncontentCommand().doCommand(cli, commands);
    assertEquals("correct CO2 output", "1743.9999999999998 lbs CO2/MWh", theAmountOfCO2);
  }

}
